package com.example;

import com.example.rabbitmq.ack.direct.DirectSendService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

@SpringBootApplication
@Slf4j
public class BootRabbitmqApplication {

    /**
     * 参考文档地址
     * https://blog.csdn.net/qq_35387940/article/details/100514134
     *
     * @param args
     */
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(BootRabbitmqApplication.class, args);
        ConfigurableEnvironment environment = run.getEnvironment();
        log.info("\n Swagger  http://localhost:{}/swagger-ui.html \n", environment.getProperty("server.port"));

        DirectSendService bean = run.getBean(DirectSendService.class);
        bean.send("你好，今天是星七月二十一");

    }

}
